/*
 * @Descripttion: 
 * @version: 
 * @Author: zero
 * @Date: 2020-04-27 22:27:02
 * @LastEditors: zero
 * @LastEditTime: 2020-04-28 17:23:25
 */
import React from 'react';
import './index.less'
import { Input } from 'antd';
import { AudioOutlined } from '@ant-design/icons';

import { connect } from 'umi';

const { Search } = Input;
//头部搜索组件
function MSearch (props) {
  console.log(props)
  function search (value) {
    console.log(value)
    props.dispatch({
      type: "headSearch/changeelse",
      payload: {
        searchValue: value
      },
    })
  }
  return (
    <div className="serach_content">
      <div className="content">
        <h2>{props.searchValue}</h2>
        <div className="search_ipt">
          <Search placeholder="input search text" onSearch={value => search(value)} enterButton />
        </div>
        <div className="call_wrap">121</div>
      </div>
    </div>
  )
}
const mapStateToProps = ({ headSearch }) => {
  return { ...headSearch };
};

export default connect(mapStateToProps)(MSearch);